#pragma once

namespace MCCommon
{
    class DBRecordSet
    {
    public:
        /**
         * Constructor.
         * 
         */
        DBRecordSet();

        /**
         * Destructor.
         * 
         */
        ~DBRecordSet();

        /**
         * Is begin of file.
         * 
         */
        bool IsBOF() const;

        /**
         * Is end of file.
         * 
         */
        bool IsEOF() const;

        /**
         * Move the record.
         * 
         */
        void MoveNext();
        void MovePrev();
        void MoveFirst();
        void MoveLast();
        
        /**
         * Get the count of rows and columns.
         * 
         */
        int GetRowCount() const;
        int GetColCount() const;

        /**
         * Data base operation.
         * 
         */
        void Add();
        void Update();
        void Delete();

        /**
         * Get field values.
         * 
         */
        bool GetFieldValue
        (
            const std::string& name,
            bool& value
        ) const;
        bool GetFieldValue
        (
            const std::string& name,
            int& value
        )const;
        bool GetFieldValue
        (
            const std::string& name,
            long& value
        )const;
        bool GetFieldValue
        (
            const std::string& name,
            double& value
        )const;
        bool GetFieldValue
        (
            const std::string& name,
            std::string& value
        )const;

        /**
         * Set field values.
         * 
         */
        void SetFieldValue
        (
            const std::string& name,
            bool value     
        );
        void SetFieldValue
        (
            const std::string& name,
            int value     
        );
        void SetFieldValue
        (
            const std::string& name,
            long value     
        );
        void SetFieldValue
        (
            const std::string& name,
            double value     
        );
        void SetFieldValue
        (
            const std::string& name,
            const std::string& value     
        );
    };

}// end of namespace MCCommon